package com.lollipop.websocket.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.server.standard.ServerEndpointExporter;

/**
 * @Author: J.K
 * @Date: 2021-06-07 16:53
 * @Description: 开启配置 注解@EnableWebSocket，表明开启WebSocket 内部实例化ServerEndpointExporter的Bean，该Bean会自动注册@ServerEndpoint注解声明的端点
 */
@Configuration
@EnableWebSocket
public class WebSocketConfig {
    @Bean
    public ServerEndpointExporter serverEndpointExporter() {
        return new ServerEndpointExporter();
    }
}
